<?php
html::printPath(array(
		'seminar.form-title' => 'admin/seminar/all',
		$registration['seminar']['name'] => '/admin/seminar/display?id=' . $registration['seminar']['id'],
		'seminar.registrationOverview' => 'admin/registration/listing?seminar_id=' . $registration['seminar']['id'],
		text::get('registration-registrationWithNumber', $registration['id']) => ''
));
$msg->printMessages();

if ($registration['payment_acceptance']['confirmed_at']) {
	echo '<p class="warningNote">' . text::getEscaped('registration-alreadyConfirmedWarning') . '</p>';
}

if (registrationUtils::canBeCancelled($registration, $registration['seminar'])) {
	echo '<ul class="commandList" style="margin-top: 0.5em">';
	echo '<li class="editLi">' . html::anchor('admin/registration/edit?id=' . $registration['id'], text::get('registration-editThis')) . '</li>';
	echo '<li class="deleteLi"><a href="#" onclick="return openInDialog(\'cancellationDialog\', \'' . text::getEscaped('myRegistration.cancellation') . '\');">' . text::getEscaped('myRegistration.cancellation') . '</a></li>';
	echo '</ul>';
}

// Cancellation dialog
echo '<div id="cancellationDialog" class="hidden">';

if ($registration['payment_acceptance']['confirmed_at']) {
	echo '<p class="warningNote">' . text::getEscaped('registration-alreadyConfirmedWarning') . '</p>';
}

$fb = new FormBuilder('registration', $registration);
$fb->setAction('/admin/registration/cancelRegistration');
$fb->textarea('cancellation_reason')->required();
$fb->submitButton('myRegistration.cancelThis');
$fb->write();

echo '</div>';

// TODO Person name

registrationHelper::printWholeRegistration($registration);
